# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=jql
pkgver=7.1.2
pkgrel=0
pkgdesc="A JSON Query Language CLI tool"
url="https://github.com/yamafaktory/jql"
arch="all"
license="MIT"
makedepends="cargo cargo-auditable"
source="https://github.com/yamafaktory/jql/archive/jql-v$pkgver.tar.gz"
options="net" # fetch dependencies
builddir="$srcdir/jql-jql-v$pkgver"

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	# core::tests::get_property_as_index seems to be broken
	cargo test --frozen -- \
		--skip core::tests::get_property_as_index
}

package() {
	install -D -m755 target/release/jql -t "$pkgdir"/usr/bin/
}

sha512sums="
41b9c83c6397868f4be969677a8125a3d0c1214b975618cfe6b9bf9e01caf15dd86fcfac55adf80111bbc3d1cf68755e7765d94223479adee4684fa162033f53  jql-v7.1.2.tar.gz
"
